//
// Created by zeng on 2021/10/16.
//

#include "Tip.h"

Tip::Tip(nlohmann::json j, int res_code) : make_up{j[0]["text"]},
                                           ultraviolet{j[1]["text"]},
                                           air{j[6]["text"]},
                                           dress{j[10]["text"]},
                                           anti_sunburn{j[11]["text"]},
                                           cold{j[12]["text"]},
                                           motion{j[15]["text"]},
                                           res_code{res_code} {
    this->value = "{'化妆':'" + make_up + "', '紫外线':'" + ultraviolet + "', '晾晒':'" + air + "', '穿衣':'"
                  + dress + "', '防晒':'" + anti_sunburn + "', '感冒':'" + cold + "', '运动':'" + motion + "'}";
}

Tip::Tip(int res_code) : res_code{res_code} {}

std::string Tip::GetValue() {
    return this->value;
}